package com.hz.friends.activity;

import com.avos.avoscloud.AVUser;
import com.hz.friends.application.CustomApplication;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

public class SystemMessageActivity extends BaseActivity implements
		OnClickListener {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_systemmessage);
		initViews();
	}

	@Override
	protected void init() {

	}

	@Override
	protected void initViews() {
		ImageButton imbtn_bar_left = (ImageButton) findViewById(R.id.imbtn_bar_left);
		ImageButton imbtn_bar_right = (ImageButton) findViewById(R.id.imbtn_bar_right);
		TextView imbtn_bar_title = (TextView) findViewById(R.id.imbtn_bar_title);
		imbtn_bar_right.setVisibility(View.INVISIBLE);
		imbtn_bar_title.setText("Message");
		imbtn_bar_left.setImageResource(R.drawable.ic_leftback_arrow);
		imbtn_bar_left.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
               finish();				
			}
		});

		LinearLayout layout1 = (LinearLayout) findViewById(R.id.layout1);
		LinearLayout layout2 = (LinearLayout) findViewById(R.id.layout2);
		LinearLayout layout3 = (LinearLayout) findViewById(R.id.layout3);
		LinearLayout layout4 = (LinearLayout) findViewById(R.id.layout4);
		layout1.setOnClickListener(this);
		layout2.setOnClickListener(this);
		layout3.setOnClickListener(this);
		layout4.setOnClickListener(this);

	}

	@Override
	protected void setViews() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void initEvents() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.layout1:
            startActivity(InvitationActivity.class);
			break;
		case R.id.layout2:
            startActivity(AttentionActivity.class);
			break;
		case R.id.layout3:
			((CustomApplication) getApplication()).user = AVUser.getCurrentUser();
            startActivity(SubMessageActivity.class);
			break;
		case R.id.layout4:
			((CustomApplication) getApplication()).user = AVUser.getCurrentUser();
            startActivity(TheGiftActivity.class);
			break;
		default:
			break;
		}
	}

}
